﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:params="http://schemas.codeplex.com/elysium/params">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Elysium;component/Themes/Generic.xaml"/>
        <ResourceDictionary Source="/Framework.UI;component/Themes/WPF/Base/FocusVisualStyle.xaml"/>
        <ResourceDictionary Source="/Framework.UI;component/Themes/WPF/Base/Validation.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <!-- TextBox - Make TextBox look like ComboBox which has less of a Border and bigger text. -->
    <Style x:Key="DefaultTextBoxStyle" BasedOn="{StaticResource TextBoxesBaseStyle}" TargetType="{x:Type TextBox}">
        <Setter Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.DefaultThickness), Mode=OneWay}"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource {x:Static SystemParameters.FocusVisualStyleKey}}"/>
        <Setter Property="FontSize" Value="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.ContentFontSize), Mode=OneWay}"/>
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Style.Triggers>
            <Trigger Property="IsReadOnly" Value="True">
                <Setter Property="BorderBrush" Value="{StaticResource TransparentBrush}"/>
            </Trigger>
            <Trigger Property="Validation.HasError" Value="True">
                <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorControlTemplate}"/>
                <Setter Property="Background" Value="{StaticResource ValidationErrorBrush}"/>
                <Setter Property="CaretBrush" Value="{StaticResource ForegroundBrush}"/>
                <Setter Property="ToolTip" Value="{StaticResource ValidationErrorToolTip}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="TransparentTextBoxStyle" BasedOn="{StaticResource {x:Type TextBox}}" TargetType="{x:Type TextBox}">
        <Setter Property="Background" Value="{StaticResource TransparentBrush}"/>
        <Setter Property="BorderThickness" Value="0"/>
    </Style>
    
    <Style x:Key="MultiLineTextBoxStyle" BasedOn="{StaticResource {x:Type TextBox}}" TargetType="{x:Type TextBox}">
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Visible"/>
        <Setter Property="AcceptsReturn" Value="True"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    </Style>

</ResourceDictionary>